import {View, Text, StyleSheet, TouchableOpacity, TouchableOpacityProps} from 'react-native'
import React, {Component} from 'react'
import {Store} from "../../../../store";
import {inject, observer} from "mobx-react/custom";
import styles, {padding} from "../../../../style";
import {AppIcon} from "../../../../assets/icon/AppIcon";

interface SignBtnProps extends Store {
    onPress: () => void,
}

interface SignBtnState {

}

@inject("user", "sign")
@observer
export default class SignBtn extends Component<SignBtnProps, SignBtnState> {


    constructor(props: SignBtnProps) {
        super(props);
    }

    render() {
        return (<TouchableOpacity activeOpacity={.7} style={[styles.flexDirectionRowNotFlex, styles.centered, {
            height: 32,
            backgroundColor: "rgba(0,0,0,.3)",
            borderRadius: 13
        }, padding(6, 10)]} onPress={this.props.onPress}>
            <AppIcon name={"qian"} size={14} color={"#FFDD00"}/>
            <Text style={SignBtnStyle.signTitle}>{this.props.sign.isAlreadySignIn ? '已签到' : "签到"}</Text>
        </TouchableOpacity>);
    }
}

const SignBtnStyle = StyleSheet.create({
    container: {},
    signTitle: {marginLeft: 5, fontSize: 16, color: "#fff"}
});

 